<?php
/**************************************************
*  Created:  2012-01-01
*
*  文件说明
*
*  @Xweibo (C)1996-2099 SINA Inc.
*  @Author gt
*
***************************************************/
class gtStarCom {
	
	/**
	 * 
	 * 根据分组得到网站明星用户和关联用户的数据
	 * @param $gid
	 */
	function getUsersByGid($gid){
		$where = "";
		if($gid){
			$where = ' WHERE gt_group_id != 0 and `gt_group_id` = ' . $gid;			
		}else{
			$where = ' WHERE gt_group_id != 0';
		}
		
		$db = APP :: ADP('db');	

		$sql = 'SELECT * FROM ' .   $db->getPrefix() . T_COMPONENT_USERS  . $where . $limit;
//		echo  $sql;
		return RST($db->query($sql));
	}
	
/**
	 * 
	 * 得到明星的分组数据
	 * @param $gid
	 */
	function getStarGroups(){
		
		
		$db = APP :: ADP('db');	

		$sql = 'SELECT * FROM ' .  'gt_group order by id' ;
//		echo  $sql;
		return RST($db->query($sql));
	}
	
	/**
	 * 得到热门话题数据
	 * Enter description here ...
	 */
	function getHotTopic(){
		$db = APP :: ADP('db');	

		$sql = 'SELECT * FROM ' .  'gt_hot_topic order by id' ;
//		echo  $sql;
		return RST($db->query($sql));
	}
	
}
